import { Component, OnInit } from '@angular/core';
import {IndexSideBarService} from "../index-side-bar.service";

@Component({
  selector: 'app-top-title',
  templateUrl: './top-title.component.html',
  styleUrls: ['./top-title.component.less']
})
export class TopTitleComponent implements OnInit {

  private showSideBar : boolean;

  constructor(private indexSideBarService: IndexSideBarService) { }

  ngOnInit() {
  }

  toggle(){

    if (this.showSideBar){
      this.indexSideBarService.toggle(IndexSideBarService.open_flag);
    }else {
      this.indexSideBarService.toggle(IndexSideBarService.close_flag);
    }

    this.showSideBar = !this.showSideBar;

  }

}
